import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index/index'
import destination from '@/components/destination/destination'
import order from '@/components/order/order'
import orderdetail from '@/components/order/orderdetail'
import orderprev from '@/components/order/orderprev'
import mine from '@/components/mine/mine'
import System from '@/components/mine/System'
import collection from '@/components/mine/collection'
import shoppingcart from '@/components/mine/shoppingcart'
import account from '@/components/mine/account'
import email from '@/components/mine/email'
import phone from '@/components/mine/phone'
import password from '@/components/mine/password'
import personalInfo from '@/components/mine/personalInfo'
import language from '@/components/mine/language'


import search from '@/components/search/search'
import login from '@/components/login/login'
import register from '@/components/login/register'
import goodslist from '@/components/goods/goodslist'
import goodinfo from '@/components/goods/goodinfo'
import evalinfo from '@/components/goods/evalinfo'
import payment from '@/components/payment/payment'
import paysuccess from '@/components/payment/paysuccess'
import payerror from '@/components/payment/payerror'

Vue.use(Router)

const router = new Router({
  routes: [
    { 
      path: '/', 
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      // meta: {
      //   keepAlive: true // 需要被缓存
      // }
    },
    {
      path: '/search',
      name: 'search',
      component: search
    },
    {
      path: '/destination',
      name: 'destination',
      component: destination
    },
    {
      path: '/order',
      name: 'order',
      component: order
    },
    {
      path: '/orderdetail',
      name: 'orderdetail',
      component: orderdetail
    },
    {
      path: '/orderprev',
      name: 'orderprev',
      component: orderprev
    },
    {
    	path: '/mine',
    	name: 'mine',
    	component: mine,
    },
    {
      path: '/System',
      name: 'System',
      component: System,
    },
    {
      path: '/shoppingcart',
      name: 'shoppingcart',
      component: shoppingcart,
    },
    {
      path: '/collection',
      name: 'collection',
      component: collection,
    },
    
    {
      path: '/language',
      name: 'language',
      component: language,
    },
    
    {
      path: '/account',
      name: 'account',
      component: account,
    },
    {
      path: '/email',
      name: 'email',
      component: email,
    },
    {
      path: '/phone',
      name: 'phone',
      component: phone,
    },
    {
      path: '/password',
      name: 'password',
      component: password,
    },
    {
      path: '/personalInfo',
      name: 'personalInfo',
      component: personalInfo,
    },
    
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/goodslist',
      name: 'goodslist',
      component: goodslist
    },
    {
      path: '/goodinfo',
      name: 'goodinfo',
      component: goodinfo,
      meta: {
        keepAlive: true // 需要被缓存
      }
    },
    {
      path: '/evalinfo',
      name: 'evalinfo',
      component: evalinfo
    },
    {
      path: '/payment',
      name: 'payment',
      component: payment
    },
    {
      path: '/paysuccess',
      name: 'paysuccess',
      component: paysuccess
    },
    {
      path: '/payerror',
      name: 'payerror',
      component: payerror
    },
    
    
  ]
})
export default router
